from flask_restful import fields  # type: ignore
from libs.helper import TimestampField
hardware_ver_fields={
    "id":fields.String,
    "tenant_id":fields.String,
    "hardware_version":fields.String(attribute="ver"),
    "descrip":fields.String,
    # "is_foce":fields.Boolean,
    "created_at":TimestampField(),
    "created_by":fields.String,
    "updated_at":TimestampField(),
    "updated_by":fields.String,
}

fver_fields={
    "id":fields.String,
    "tenant_id":fields.String,
    "ver":fields.String,
    "md5":fields.String,
    "file_id":fields.String,
    "file_url":fields.String,
    "url":fields.String,
    "agent_type":fields.String,
    "is_new":fields.Boolean,
    "descrip":fields.String,
    "created_at":TimestampField(),
    "updated_at":TimestampField(),
    "created_by":fields.String,
    "updated_by":fields.String,
}

fver_list_fields={
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(fver_fields))
}


fver_task_result_fields={
    "id":fields.Integer,
    "task_id":fields.String,
    "new_ver":fields.String,
    "robot_id":fields.String,
    "status":fields.String,
    "last_state_at":TimestampField(),
    "pushed_at":TimestampField(),
    "update_at":TimestampField(),
    "updated_at":TimestampField(),
}
fver_task_result_list_fields={
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(fver_task_result_fields))
}

fver_task_fields={
    "id":fields.String,
    "name":fields.String,
    "fver_id":fields.String,
    "reservation_at":TimestampField(),
    "remark":fields.String,
    "created_at":TimestampField(),
    "created_by":fields.String,
    "robot_count":fields.Integer,
    # "results":fields.List(fields.Nested(fver_task_result_fields)),
}